<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/logo.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/logo.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/logo.png">
  <link rel="mask-icon" href="/images/logo.png" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gitee.com","root":"/","scheme":"Pisces","version":"7.7.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"./public/search.xml"};
  </script>

  <meta name="description" content="click look more">
<meta property="og:type" content="article">
<meta property="og:title" content="电商管理后台 API 接口文档">
<meta property="og:url" content="https://gitee.com/mamba666/mamba666.git/2020/06/08/%E7%94%B5%E5%95%86%E7%AE%A1%E7%90%86%E5%90%8E%E5%8F%B0%20API%20%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3/index.html">
<meta property="og:site_name" content="共你云雨">
<meta property="og:description" content="click look more">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-06-08T00:48:17.134Z">
<meta property="article:modified_time" content="2020-06-12T03:45:44.098Z">
<meta property="article:author" content="Edison">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://gitee.com/mamba666/mamba666.git/2020/06/08/%E7%94%B5%E5%95%86%E7%AE%A1%E7%90%86%E5%90%8E%E5%8F%B0%20API%20%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true
  };
</script>

  <title>电商管理后台 API 接口文档 | 共你云雨</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>
	<a href="https://github.com/mamba666" target="_blank" rel="noopener" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">共你云雨</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/mamba666/mamba666.git/2020/06/08/%E7%94%B5%E5%95%86%E7%AE%A1%E7%90%86%E5%90%8E%E5%8F%B0%20API%20%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Edison">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="共你云雨">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          电商管理后台 API 接口文档
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-06-08 08:48:17" itemprop="dateCreated datePublished" datetime="2020-06-08T08:48:17+08:00">2020-06-08</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-06-12 11:45:44" itemprop="dateModified" datetime="2020-06-12T11:45:44+08:00">2020-06-12</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3/" itemprop="url" rel="index"><span itemprop="name">接口文档</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>click look more</p>
<a id="more"></a>

<h1 id="1-电商管理后台-API-接口文档"><a href="#1-电商管理后台-API-接口文档" class="headerlink" title="1. 电商管理后台 API 接口文档"></a>1. 电商管理后台 API 接口文档</h1><h2 id="1-1-API-V1-接口说明"><a href="#1-1-API-V1-接口说明" class="headerlink" title="1.1. API V1 接口说明"></a>1.1. API V1 接口说明</h2><ul>
<li>接口基准地址：<code>http://127.0.0.1:8888/api/private/v1/</code></li>
<li>服务端已开启 CORS 跨域支持</li>
<li>API V1 认证统一使用 Token 认证</li>
<li>需要授权的 API ，必须在请求头中使用 <code>Authorization</code> 字段提供 <code>token</code> 令牌</li>
<li>使用 HTTP Status Code 标识状态</li>
<li>数据返回格式统一使用 JSON</li>
</ul>
<h3 id="1-1-1-支持的请求方法"><a href="#1-1-1-支持的请求方法" class="headerlink" title="1.1.1. 支持的请求方法"></a>1.1.1. 支持的请求方法</h3><ul>
<li>GET（SELECT）：从服务器取出资源（一项或多项）。</li>
<li>POST（CREATE）：在服务器新建一个资源。</li>
<li>PUT（UPDATE）：在服务器更新资源（客户端提供改变后的完整资源）。</li>
<li>PATCH（UPDATE）：在服务器更新资源（客户端提供改变的属性）。</li>
<li>DELETE（DELETE）：从服务器删除资源。</li>
<li>HEAD：获取资源的元数据。</li>
<li>OPTIONS：获取信息，关于资源的哪些属性是客户端可以改变的。</li>
</ul>
<h3 id="1-1-2-通用返回状态说明"><a href="#1-1-2-通用返回状态说明" class="headerlink" title="1.1.2. 通用返回状态说明"></a>1.1.2. 通用返回状态说明</h3><table>
<thead>
<tr>
<th><em>状态码</em></th>
<th><em>含义</em></th>
<th><em>说明</em></th>
</tr>
</thead>
<tbody><tr>
<td>200</td>
<td>OK</td>
<td>请求成功</td>
</tr>
<tr>
<td>201</td>
<td>CREATED</td>
<td>创建成功</td>
</tr>
<tr>
<td>204</td>
<td>DELETED</td>
<td>删除成功</td>
</tr>
<tr>
<td>400</td>
<td>BAD REQUEST</td>
<td>请求的地址不存在或者包含不支持的参数</td>
</tr>
<tr>
<td>401</td>
<td>UNAUTHORIZED</td>
<td>未授权</td>
</tr>
<tr>
<td>403</td>
<td>FORBIDDEN</td>
<td>被禁止访问</td>
</tr>
<tr>
<td>404</td>
<td>NOT FOUND</td>
<td>请求的资源不存在</td>
</tr>
<tr>
<td>422</td>
<td>Unprocesable entity</td>
<td>[POST/PUT/PATCH] 当创建一个对象时，发生一个验证错误</td>
</tr>
<tr>
<td>500</td>
<td>INTERNAL SERVER ERROR</td>
<td>内部错误</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<hr>
<h2 id="1-2-登录"><a href="#1-2-登录" class="headerlink" title="1.2. 登录"></a>1.2. 登录</h2><h3 id="1-2-1-登录验证接口"><a href="#1-2-1-登录验证接口" class="headerlink" title="1.2.1. 登录验证接口"></a>1.2.1. 登录验证接口</h3><ul>
<li>请求路径：login</li>
<li>请求方法：post</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>username</td>
<td>用户名</td>
<td>不能为空</td>
</tr>
<tr>
<td>password</td>
<td>密码</td>
<td>不能为空</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 ID</td>
<td></td>
</tr>
<tr>
<td>rid</td>
<td>用户角色 ID</td>
<td></td>
</tr>
<tr>
<td>username</td>
<td>用户名</td>
<td></td>
</tr>
<tr>
<td>mobile</td>
<td>手机号</td>
<td></td>
</tr>
<tr>
<td>email</td>
<td>邮箱</td>
<td></td>
</tr>
<tr>
<td>token</td>
<td>令牌</td>
<td>基于 jwt 的令牌</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"id"</span>: <span class="number">500</span>,</span><br><span class="line">        <span class="attr">"rid"</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="attr">"username"</span>: <span class="string">"admin"</span>,</span><br><span class="line">        <span class="attr">"mobile"</span>: <span class="string">"123"</span>,</span><br><span class="line">        <span class="attr">"email"</span>: <span class="string">"123@qq.com"</span>,</span><br><span class="line">        <span class="attr">"token"</span>: <span class="string">"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1MTI1NDQyOTksImV4cCI6MTUxMjYzMDY5OX0.eGrsrvwHm-tPsO9r_pxHIQ5i5L1kX9RX444uwnRGaIM"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"登录成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="1-3-用户管理"><a href="#1-3-用户管理" class="headerlink" title="1.3. 用户管理"></a>1.3. 用户管理</h2><h3 id="1-3-1-用户数据列表"><a href="#1-3-1-用户数据列表" class="headerlink" title="1.3.1. 用户数据列表"></a>1.3.1. 用户数据列表</h3><ul>
<li>请求路径：users</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>query</td>
<td>查询参数</td>
<td>可以为空</td>
</tr>
<tr>
<td>pagenum</td>
<td>当前页码</td>
<td>不能为空</td>
</tr>
<tr>
<td>pagesize</td>
<td>每页显示条数</td>
<td>不能为空</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>totalpage</td>
<td>总记录数</td>
<td></td>
</tr>
<tr>
<td>pagenum</td>
<td>当前页码</td>
<td></td>
</tr>
<tr>
<td>users</td>
<td>用户数据集合</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"totalpage"</span>: <span class="number">5</span>,</span><br><span class="line">        <span class="attr">"pagenum"</span>: <span class="number">4</span>,</span><br><span class="line">        <span class="attr">"users"</span>: [</span><br><span class="line">            &#123;</span><br><span class="line">                <span class="attr">"id"</span>: <span class="number">25</span>,</span><br><span class="line">                <span class="attr">"username"</span>: <span class="string">"tige117"</span>,</span><br><span class="line">                <span class="attr">"mobile"</span>: <span class="string">"18616358651"</span>,</span><br><span class="line">                <span class="attr">"type"</span>: <span class="number">1</span>,</span><br><span class="line">                <span class="attr">"email"</span>: <span class="string">"tige112@163.com"</span>,</span><br><span class="line">                <span class="attr">"create_time"</span>: <span class="string">"2017-11-09T20:36:26.000Z"</span>,</span><br><span class="line">                <span class="attr">"mg_state"</span>: <span class="literal">true</span>, <span class="comment">// 当前用户的状态</span></span><br><span class="line">                <span class="attr">"role_name"</span>: <span class="string">"炒鸡管理员"</span></span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"获取成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-3-2-添加用户"><a href="#1-3-2-添加用户" class="headerlink" title="1.3.2. 添加用户"></a>1.3.2. 添加用户</h3><ul>
<li>请求路径：users</li>
<li>请求方法：post</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>username</td>
<td>用户名称</td>
<td>不能为空</td>
</tr>
<tr>
<td>password</td>
<td>用户密码</td>
<td>不能为空</td>
</tr>
<tr>
<td>email</td>
<td>邮箱</td>
<td>可以为空</td>
</tr>
<tr>
<td>mobile</td>
<td>手机号</td>
<td>可以为空</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 ID</td>
<td></td>
</tr>
<tr>
<td>rid</td>
<td>用户角色 ID</td>
<td></td>
</tr>
<tr>
<td>username</td>
<td>用户名</td>
<td></td>
</tr>
<tr>
<td>mobile</td>
<td>手机号</td>
<td></td>
</tr>
<tr>
<td>email</td>
<td>邮箱</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"id"</span>: <span class="number">28</span>,</span><br><span class="line">        <span class="attr">"username"</span>: <span class="string">"tige1200"</span>,</span><br><span class="line">        <span class="attr">"mobile"</span>: <span class="string">"test"</span>,</span><br><span class="line">        <span class="attr">"type"</span>: <span class="number">1</span>,</span><br><span class="line">        <span class="attr">"openid"</span>: <span class="string">""</span>,</span><br><span class="line">        <span class="attr">"email"</span>: <span class="string">"test@test.com"</span>,</span><br><span class="line">        <span class="attr">"create_time"</span>: <span class="string">"2017-11-10T03:47:13.533Z"</span>,</span><br><span class="line">        <span class="attr">"modify_time"</span>: <span class="literal">null</span>,</span><br><span class="line">        <span class="attr">"is_delete"</span>: <span class="literal">false</span>,</span><br><span class="line">        <span class="attr">"is_active"</span>: <span class="literal">false</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"用户创建成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">201</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-3-3-修改用户状态"><a href="#1-3-3-修改用户状态" class="headerlink" title="1.3.3. 修改用户状态"></a>1.3.3. 修改用户状态</h3><ul>
<li>请求路径：users/:uId/state/:type</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>uId</td>
<td>用户 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>type</td>
<td>用户状态</td>
<td>不能为空<code>携带在url中</code>，值为 true 或者 false</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  <span class="attr">"data"</span>: &#123;</span><br><span class="line">    <span class="attr">"id"</span>: <span class="number">566</span>,</span><br><span class="line">    <span class="attr">"rid"</span>: <span class="number">30</span>,</span><br><span class="line">    <span class="attr">"username"</span>: <span class="string">"admin"</span>,</span><br><span class="line">    <span class="attr">"mobile"</span>: <span class="string">"123456"</span>,</span><br><span class="line">    <span class="attr">"email"</span>: <span class="string">"bb@itcast.com"</span>,</span><br><span class="line">    <span class="attr">"mg_state"</span>: <span class="number">0</span></span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="attr">"meta"</span>: &#123;</span><br><span class="line">    <span class="attr">"msg"</span>: <span class="string">"设置状态成功"</span>,</span><br><span class="line">    <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-3-4-根据-ID-查询用户信息"><a href="#1-3-4-根据-ID-查询用户信息" class="headerlink" title="1.3.4. 根据 ID 查询用户信息"></a>1.3.4. 根据 ID 查询用户信息</h3><ul>
<li>请求路径：users/:id</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 ID</td>
<td></td>
</tr>
<tr>
<td>role_id</td>
<td>角色 ID</td>
<td></td>
</tr>
<tr>
<td>mobile</td>
<td>手机号</td>
<td></td>
</tr>
<tr>
<td>email</td>
<td>邮箱</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"id"</span>: <span class="number">503</span>,</span><br><span class="line">        <span class="attr">"username"</span>: <span class="string">"admin3"</span>,</span><br><span class="line">        <span class="attr">"role_id"</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="attr">"mobile"</span>: <span class="string">"00000"</span>,</span><br><span class="line">        <span class="attr">"email"</span>: <span class="string">"new@new.com"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"查询成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-3-5-编辑用户提交"><a href="#1-3-5-编辑用户提交" class="headerlink" title="1.3.5. 编辑用户提交"></a>1.3.5. 编辑用户提交</h3><ul>
<li>请求路径：users/:id</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 id</td>
<td>不能为空 <code>参数是url参数:id</code></td>
</tr>
<tr>
<td>email</td>
<td>邮箱</td>
<td>可以为空</td>
</tr>
<tr>
<td>mobile</td>
<td>手机号</td>
<td>可以为空</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 ID</td>
<td></td>
</tr>
<tr>
<td>role_id</td>
<td>角色 ID</td>
<td></td>
</tr>
<tr>
<td>mobile</td>
<td>手机号</td>
<td></td>
</tr>
<tr>
<td>email</td>
<td>邮箱</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 200表示成功，500表示失败 */</span></span><br><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"id"</span>: <span class="number">503</span>,</span><br><span class="line">        <span class="attr">"username"</span>: <span class="string">"admin3"</span>,</span><br><span class="line">        <span class="attr">"role_id"</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="attr">"mobile"</span>: <span class="string">"111"</span>,</span><br><span class="line">        <span class="attr">"email"</span>: <span class="string">"123@123.com"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"更新成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-3-6-删除单个用户"><a href="#1-3-6-删除单个用户" class="headerlink" title="1.3.6. 删除单个用户"></a>1.3.6. 删除单个用户</h3><ul>
<li>请求路径：users/:id</li>
<li>请求方法：delete</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 id</td>
<td>不能为空<code>参数是url参数:id</code></td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: <span class="literal">null</span>,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"删除成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-3-7-分配用户角色"><a href="#1-3-7-分配用户角色" class="headerlink" title="1.3.7. 分配用户角色"></a>1.3.7. 分配用户角色</h3><ul>
<li>请求路径：users/:id/role</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 ID</td>
<td>不能为空<code>参数是url参数:id</code></td>
</tr>
<tr>
<td>rid</td>
<td>角色 id</td>
<td>不能为空<code>参数body参数</code></td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>用户 ID</td>
<td></td>
</tr>
<tr>
<td>role_id</td>
<td>角色 ID</td>
<td></td>
</tr>
<tr>
<td>mobile</td>
<td>手机号</td>
<td></td>
</tr>
<tr>
<td>email</td>
<td>邮箱</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"id"</span>: <span class="number">508</span>,</span><br><span class="line">        <span class="attr">"rid"</span>: <span class="string">"30"</span>,</span><br><span class="line">        <span class="attr">"username"</span>: <span class="string">"asdf1"</span>,</span><br><span class="line">        <span class="attr">"mobile"</span>: <span class="string">"123123"</span>,</span><br><span class="line">        <span class="attr">"email"</span>: <span class="string">"adfsa@qq.com"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"设置角色成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="1-4-权限管理"><a href="#1-4-权限管理" class="headerlink" title="1.4. 权限管理"></a>1.4. 权限管理</h2><h3 id="1-4-1-所有权限列表"><a href="#1-4-1-所有权限列表" class="headerlink" title="1.4.1. 所有权限列表"></a>1.4.1. 所有权限列表</h3><ul>
<li>请求路径：rights/:type</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>type</td>
<td>类型</td>
<td>值 list 或 tree , list 列表显示权限, tree 树状显示权限,<code>参数是url参数:type</code></td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>权限 ID</td>
<td></td>
</tr>
<tr>
<td>authName</td>
<td>权限说明</td>
<td></td>
</tr>
<tr>
<td>level</td>
<td>权限层级</td>
<td></td>
</tr>
<tr>
<td>pid</td>
<td>权限父 ID</td>
<td></td>
</tr>
<tr>
<td>path</td>
<td>对应访问路径</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据 type=list</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">  &#123;</span><br><span class="line">    <span class="attr">"data"</span>: [</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="attr">"id"</span>: <span class="number">101</span>,</span><br><span class="line">            <span class="attr">"authName"</span>: <span class="string">"商品管理"</span>,</span><br><span class="line">            <span class="attr">"level"</span>: <span class="string">"0"</span>,</span><br><span class="line">            <span class="attr">"pid"</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="attr">"path"</span>: <span class="literal">null</span></span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="attr">"id"</span>: <span class="number">102</span>,</span><br><span class="line">            <span class="attr">"authName"</span>: <span class="string">"订单管理"</span>,</span><br><span class="line">            <span class="attr">"level"</span>: <span class="string">"0"</span>,</span><br><span class="line">            <span class="attr">"pid"</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="attr">"path"</span>: <span class="literal">null</span></span><br><span class="line">        &#125;</span><br><span class="line">    ],</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"获取权限列表成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>type=tree</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  data: [</span><br><span class="line">    &#123;</span><br><span class="line">      id: 101,</span><br><span class="line">      authName: '商品管理',</span><br><span class="line">      path: null,</span><br><span class="line">      pid: 0,</span><br><span class="line">      children: [</span><br><span class="line">        &#123;</span><br><span class="line">          id: 104,</span><br><span class="line">          authName: '商品列表',</span><br><span class="line">          path: null,</span><br><span class="line">          pid: 101,</span><br><span class="line">          children: [</span><br><span class="line">            &#123;</span><br><span class="line">              id: 105,</span><br><span class="line">              authName: '添加商品',</span><br><span class="line">              path: null,</span><br><span class="line">              pid: '104,101'</span><br><span class="line">            &#125;</span><br><span class="line">          ]</span><br><span class="line">        &#125;</span><br><span class="line">      ]</span><br><span class="line">    &#125;</span><br><span class="line">  ],</span><br><span class="line">  meta: &#123;</span><br><span class="line">    msg: '获取权限列表成功',</span><br><span class="line">    status: 200</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-4-2-左侧菜单权限"><a href="#1-4-2-左侧菜单权限" class="headerlink" title="1.4.2. 左侧菜单权限"></a>1.4.2. 左侧菜单权限</h3><ul>
<li>请求路径：menus</li>
<li>请求方法：get</li>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>:</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="attr">"id"</span>: <span class="number">101</span>,</span><br><span class="line">            <span class="attr">"authName"</span>: <span class="string">"商品管理"</span>,</span><br><span class="line">            <span class="attr">"path"</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="attr">"children"</span>: [</span><br><span class="line">                &#123;</span><br><span class="line">                    <span class="attr">"id"</span>: <span class="number">104</span>,</span><br><span class="line">                    <span class="attr">"authName"</span>: <span class="string">"商品列表"</span>,</span><br><span class="line">                    <span class="attr">"path"</span>: <span class="literal">null</span>,</span><br><span class="line">                    <span class="attr">"children"</span>: []</span><br><span class="line">                &#125;</span><br><span class="line">            ]</span><br><span class="line">        &#125;</span><br><span class="line">    <span class="string">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"获取菜单列表成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="1-5-角色管理"><a href="#1-5-角色管理" class="headerlink" title="1.5. 角色管理"></a>1.5. 角色管理</h2><h3 id="1-5-1-角色列表"><a href="#1-5-1-角色列表" class="headerlink" title="1.5.1. 角色列表"></a>1.5.1. 角色列表</h3><ul>
<li><p>请求路径：roles</p>
</li>
<li><p>请求方法：get</p>
</li>
<li><p>响应数据说明</p>
<ul>
<li>第一层为角色信息</li>
</ul>
<ul>
<li>第二层开始为权限说明，权限一共有 3 层权限</li>
<li>最后一层权限，不包含 <code>children</code> 属性</li>
</ul>
</li>
<li><p>响应数据</p>
</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: [</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="attr">"id"</span>: <span class="number">30</span>,</span><br><span class="line">            <span class="attr">"roleName"</span>: <span class="string">"主管"</span>,</span><br><span class="line">            <span class="attr">"roleDesc"</span>: <span class="string">"技术负责人"</span>,</span><br><span class="line">            <span class="attr">"children"</span>: [</span><br><span class="line">                &#123;</span><br><span class="line">                    <span class="attr">"id"</span>: <span class="number">101</span>,</span><br><span class="line">                    <span class="attr">"authName"</span>: <span class="string">"商品管理"</span>,</span><br><span class="line">                    <span class="attr">"path"</span>: <span class="literal">null</span>,</span><br><span class="line">                    <span class="attr">"children"</span>: [</span><br><span class="line">                        &#123;</span><br><span class="line">                            <span class="attr">"id"</span>: <span class="number">104</span>,</span><br><span class="line">                            <span class="attr">"authName"</span>: <span class="string">"商品列表"</span>,</span><br><span class="line">                            <span class="attr">"path"</span>: <span class="literal">null</span>,</span><br><span class="line">                            <span class="attr">"children"</span>: [</span><br><span class="line">                                &#123;</span><br><span class="line">                                    <span class="attr">"id"</span>: <span class="number">105</span>,</span><br><span class="line">                                    <span class="attr">"authName"</span>: <span class="string">"添加商品"</span>,</span><br><span class="line">                                    <span class="attr">"path"</span>: <span class="literal">null</span></span><br><span class="line">                                &#125;</span><br><span class="line">                            ]</span><br><span class="line">                        &#125;</span><br><span class="line">                    ]</span><br><span class="line">                &#125;</span><br><span class="line">            ]</span><br><span class="line">        &#125;</span><br><span class="line">    ],</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"获取成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-5-2-添加角色"><a href="#1-5-2-添加角色" class="headerlink" title="1.5.2. 添加角色"></a>1.5.2. 添加角色</h3><ul>
<li>请求路径：roles</li>
<li>请求方法：post</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>roleName</td>
<td>角色名称</td>
<td>不能为空</td>
</tr>
<tr>
<td>roleDesc</td>
<td>角色描述</td>
<td>可以为空</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>roleId</td>
<td>角色 ID</td>
<td></td>
</tr>
<tr>
<td>roleName</td>
<td>角色名称</td>
<td></td>
</tr>
<tr>
<td>roleDesc</td>
<td>角色描述</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"roleId"</span>: <span class="number">40</span>,</span><br><span class="line">        <span class="attr">"roleName"</span>: <span class="string">"admin2"</span>,</span><br><span class="line">        <span class="attr">"roleDesc"</span>: <span class="string">"admin2Desc"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"创建成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">201</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-5-3-根据-ID-查询角色"><a href="#1-5-3-根据-ID-查询角色" class="headerlink" title="1.5.3. 根据 ID 查询角色"></a>1.5.3. 根据 ID 查询角色</h3><ul>
<li>请求路径：roles/:id</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>角色 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>roleId</td>
<td>角色 ID</td>
<td></td>
</tr>
<tr>
<td>roleName</td>
<td>角色名称</td>
<td></td>
</tr>
<tr>
<td>roleDesc</td>
<td>角色描述</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"roleId"</span>: <span class="number">31</span>,</span><br><span class="line">        <span class="attr">"roleName"</span>: <span class="string">"测试角色"</span>,</span><br><span class="line">        <span class="attr">"roleDesc"</span>: <span class="string">"测试负责人"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"获取成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-5-4-编辑提交角色"><a href="#1-5-4-编辑提交角色" class="headerlink" title="1.5.4. 编辑提交角色"></a>1.5.4. 编辑提交角色</h3><ul>
<li>请求路径：roles/:id</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>角色 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>roleName</td>
<td>角色名称</td>
<td>不能为空</td>
</tr>
<tr>
<td>roleDesc</td>
<td>角色描述</td>
<td>可以为空</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"roleId"</span>: <span class="number">31</span>,</span><br><span class="line">        <span class="attr">"roleName"</span>: <span class="string">"测试角色"</span>,</span><br><span class="line">        <span class="attr">"roleDesc"</span>: <span class="string">"测试角色描述"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"获取成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-5-5-删除角色"><a href="#1-5-5-删除角色" class="headerlink" title="1.5.5. 删除角色"></a>1.5.5. 删除角色</h3><ul>
<li>请求路径：roles/:id</li>
<li>请求方法：delete</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>角色 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: <span class="literal">null</span>,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"删除成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-5-6-角色授权"><a href="#1-5-6-角色授权" class="headerlink" title="1.5.6. 角色授权"></a>1.5.6. 角色授权</h3><ul>
<li>请求路径：roles/:roleId/rights</li>
<li>请求方法：post</li>
<li>请求参数：通过 <code>请求体</code> 发送给后端</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:roleId</td>
<td>角色 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>rids</td>
<td>权限 ID 列表（字符串）</td>
<td>以 <code>,</code> 分割的权限 ID 列表（获取所有被选中、叶子节点的key和半选中节点的key, 包括 1，2，3级节点）</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: <span class="literal">null</span>,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"更新成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-5-7-删除角色指定权限"><a href="#1-5-7-删除角色指定权限" class="headerlink" title="1.5.7. 删除角色指定权限"></a>1.5.7. 删除角色指定权限</h3><ul>
<li><p>请求路径：roles/:roleId/rights/:rightId</p>
</li>
<li><p>请求方法：delete</p>
</li>
<li><p>请求参数</p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:roleId</td>
<td>角色 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>:rightId</td>
<td>权限 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
</li>
<li><p>响应数据说明 </p>
<ul>
<li>返回的data, 是当前角色下最新的权限数据</li>
</ul>
</li>
<li><p>响应数据</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: [</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="attr">"id"</span>: <span class="number">101</span>,</span><br><span class="line">            <span class="attr">"authName"</span>: <span class="string">"商品管理"</span>,</span><br><span class="line">            <span class="attr">"path"</span>: <span class="literal">null</span>,</span><br><span class="line">            <span class="attr">"children"</span>: [</span><br><span class="line">                &#123;</span><br><span class="line">                    <span class="attr">"id"</span>: <span class="number">104</span>,</span><br><span class="line">                    <span class="attr">"authName"</span>: <span class="string">"商品列表"</span>,</span><br><span class="line">                    <span class="attr">"path"</span>: <span class="literal">null</span>,</span><br><span class="line">                    <span class="attr">"children"</span>: [</span><br><span class="line">                        &#123;</span><br><span class="line">                            <span class="attr">"id"</span>: <span class="number">105</span>,</span><br><span class="line">                            <span class="attr">"authName"</span>: <span class="string">"添加商品"</span>,</span><br><span class="line">                            <span class="attr">"path"</span>: <span class="literal">null</span></span><br><span class="line">                        &#125;,</span><br><span class="line">                        &#123;</span><br><span class="line">                            <span class="attr">"id"</span>: <span class="number">116</span>,</span><br><span class="line">                            <span class="attr">"authName"</span>: <span class="string">"修改"</span>,</span><br><span class="line">                            <span class="attr">"path"</span>: <span class="literal">null</span></span><br><span class="line">                        &#125;</span><br><span class="line">                    ]</span><br><span class="line">                &#125;</span><br><span class="line">            ]</span><br><span class="line">        &#125;</span><br><span class="line">    ],</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"取消权限成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

</li>
</ul>
<h2 id="1-6-商品分类管理"><a href="#1-6-商品分类管理" class="headerlink" title="1.6. 商品分类管理"></a>1.6. 商品分类管理</h2><h3 id="1-6-1-商品分类数据列表"><a href="#1-6-1-商品分类数据列表" class="headerlink" title="1.6.1. 商品分类数据列表"></a>1.6.1. 商品分类数据列表</h3><ul>
<li>请求路径：categories</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>type</td>
<td>[1,2,3]</td>
<td>值：1，2，3 分别表示显示一层二层三层分类列表<br>【可选参数】如果不传递，则默认获取所有级别的分类</td>
</tr>
<tr>
<td>pagenum</td>
<td>当前页码值</td>
<td>【可选参数】如果不传递，则默认获取所有分类</td>
</tr>
<tr>
<td>pagesize</td>
<td>每页显示多少条数据</td>
<td>【可选参数】如果不传递，则默认获取所有分类</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>cat_id</td>
<td>分类 ID</td>
<td></td>
</tr>
<tr>
<td>cat_name</td>
<td>分类名称</td>
<td></td>
</tr>
<tr>
<td>cat_pid</td>
<td>分类父 ID</td>
<td></td>
</tr>
<tr>
<td>cat_level</td>
<td>分类当前层级</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: [</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="attr">"cat_id"</span>: <span class="number">1</span>,</span><br><span class="line">            <span class="attr">"cat_name"</span>: <span class="string">"大家电"</span>,</span><br><span class="line">            <span class="attr">"cat_pid"</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="attr">"cat_level"</span>: <span class="number">0</span>,</span><br><span class="line">            <span class="attr">"cat_deleted"</span>: <span class="literal">false</span>,</span><br><span class="line">            <span class="attr">"children"</span>: [</span><br><span class="line">                &#123;</span><br><span class="line">                    <span class="attr">"cat_id"</span>: <span class="number">3</span>,</span><br><span class="line">                    <span class="attr">"cat_name"</span>: <span class="string">"电视"</span>,</span><br><span class="line">                    <span class="attr">"cat_pid"</span>: <span class="number">1</span>,</span><br><span class="line">                    <span class="attr">"cat_level"</span>: <span class="number">1</span>,</span><br><span class="line">                    <span class="attr">"cat_deleted"</span>: <span class="literal">false</span>,</span><br><span class="line">                    <span class="attr">"children"</span>: [</span><br><span class="line">                        &#123;</span><br><span class="line">                            <span class="attr">"cat_id"</span>: <span class="number">6</span>,</span><br><span class="line">                            <span class="attr">"cat_name"</span>: <span class="string">"曲面电视"</span>,</span><br><span class="line">                            <span class="attr">"cat_pid"</span>: <span class="number">3</span>,</span><br><span class="line">                            <span class="attr">"cat_level"</span>: <span class="number">2</span>,</span><br><span class="line">                            <span class="attr">"cat_deleted"</span>: <span class="literal">false</span></span><br><span class="line">                        &#125;,</span><br><span class="line">                        &#123;</span><br><span class="line">                            <span class="attr">"cat_id"</span>: <span class="number">7</span>,</span><br><span class="line">                            <span class="attr">"cat_name"</span>: <span class="string">"海信"</span>,</span><br><span class="line">                            <span class="attr">"cat_pid"</span>: <span class="number">3</span>,</span><br><span class="line">                            <span class="attr">"cat_level"</span>: <span class="number">2</span>,</span><br><span class="line">                            <span class="attr">"cat_deleted"</span>: <span class="literal">false</span></span><br><span class="line">                        &#125;</span><br><span class="line">                    ]</span><br><span class="line">                &#125;</span><br><span class="line">            ]</span><br><span class="line">        &#125;</span><br><span class="line">    ],</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"获取成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">200</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-6-2-添加分类"><a href="#1-6-2-添加分类" class="headerlink" title="1.6.2. 添加分类"></a>1.6.2. 添加分类</h3><ul>
<li>请求路径：categories</li>
<li>请求方法：post</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>cat_pid</td>
<td>分类父 ID</td>
<td>不能为空，如果要添加1级分类，则父分类Id应该设置为  <code>0</code></td>
</tr>
<tr>
<td>cat_name</td>
<td>分类名称</td>
<td>不能为空</td>
</tr>
<tr>
<td>cat_level</td>
<td>分类层级</td>
<td>不能为空，<code>0</code>表示一级分类；<code>1</code>表示二级分类；<code>2</code>表示三级分类</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"cat_id"</span>: <span class="number">62</span>,</span><br><span class="line">        <span class="attr">"cat_name"</span>: <span class="string">"相框"</span>,</span><br><span class="line">        <span class="attr">"cat_pid"</span>: <span class="string">"1"</span>,</span><br><span class="line">        <span class="attr">"cat_level"</span>: <span class="string">"1"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"创建成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">201</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-6-3-根据-id-查询分类"><a href="#1-6-3-根据-id-查询分类" class="headerlink" title="1.6.3. 根据 id 查询分类"></a>1.6.3. 根据 id 查询分类</h3><ul>
<li>请求路径：categories/:id</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;cat_id&quot;: 3,</span><br><span class="line">        &quot;cat_name&quot;: &quot;厨卫电器&quot;,</span><br><span class="line">        &quot;cat_pid&quot;: 0,</span><br><span class="line">        &quot;cat_level&quot;: 0</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;获取成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-6-4-编辑提交分类"><a href="#1-6-4-编辑提交分类" class="headerlink" title="1.6.4. 编辑提交分类"></a>1.6.4. 编辑提交分类</h3><ul>
<li>请求路径：categories/:id</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>cat_name</td>
<td>分类名称</td>
<td>不能为空【此参数，放到请求体中】</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;cat_id&quot;: 22,</span><br><span class="line">        &quot;cat_name&quot;: &quot;自拍杆&quot;,</span><br><span class="line">        &quot;cat_pid&quot;: 7,</span><br><span class="line">        &quot;cat_level&quot;: 2</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;更新成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-6-5-删除分类"><a href="#1-6-5-删除分类" class="headerlink" title="1.6.5. 删除分类"></a>1.6.5. 删除分类</h3><ul>
<li>请求路径：categories/:id</li>
<li>请求方法：delete</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: null,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;删除成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="1-7-分类参数管理"><a href="#1-7-分类参数管理" class="headerlink" title="1.7. 分类参数管理"></a>1.7. 分类参数管理</h2><h3 id="1-7-1-参数列表"><a href="#1-7-1-参数列表" class="headerlink" title="1.7.1. 参数列表"></a>1.7.1. 参数列表</h3><ul>
<li>请求路径：categories/:id/attributes</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>sel</td>
<td>[only,many]</td>
<td>不能为空,通过 only 或 many 来获取分类静态参数还是动态参数</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>attr_id</td>
<td>分类参数 ID</td>
<td></td>
</tr>
<tr>
<td>attr_name</td>
<td>分类参数名称</td>
<td></td>
</tr>
<tr>
<td>cat_id</td>
<td>分类参数所属分类</td>
<td></td>
</tr>
<tr>
<td>attr_sel</td>
<td>only:输入框(唯一) many:后台下拉列表/前台单选框</td>
<td></td>
</tr>
<tr>
<td>attr_write</td>
<td>manual:手工录入 list:从列表选择</td>
<td></td>
</tr>
<tr>
<td>attr_vals</td>
<td>如果 attr_write:list,那么有值，该值以逗号分隔</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: [</span><br><span class="line">        &#123;</span><br><span class="line">            &quot;attr_id&quot;: 1,</span><br><span class="line">            &quot;attr_name&quot;: &quot;cpu&quot;,</span><br><span class="line">            &quot;cat_id&quot;: 22,</span><br><span class="line">            &quot;attr_sel&quot;: &quot;only&quot;,</span><br><span class="line">            &quot;attr_write&quot;: &quot;manual&quot;,</span><br><span class="line">            &quot;attr_vals&quot;: &quot;ffff&quot;</span><br><span class="line">        &#125;</span><br><span class="line">    ],</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;获取成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-7-2-添加动态参数或者静态属性"><a href="#1-7-2-添加动态参数或者静态属性" class="headerlink" title="1.7.2. 添加动态参数或者静态属性"></a>1.7.2. 添加动态参数或者静态属性</h3><ul>
<li>请求路径：categories/:id/attributes</li>
<li>请求方法：post</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>attr_name</td>
<td>参数名称</td>
<td>不能为空</td>
</tr>
<tr>
<td>attr_sel</td>
<td>[only,many]</td>
<td>不能为空</td>
</tr>
<tr>
<td>attr_vals</td>
<td>如果是 many 就需要填写值的选项，以逗号分隔</td>
<td>【可选参数】</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;attr_id&quot;: 44,</span><br><span class="line">        &quot;attr_name&quot;: &quot;测试参数&quot;,</span><br><span class="line">        &quot;cat_id&quot;: &quot;1&quot;,</span><br><span class="line">        &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">        &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">        &quot;attr_vals&quot;: &quot;a,b,c&quot;</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;创建成功&quot;,</span><br><span class="line">        &quot;status&quot;: 201</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-7-3-删除参数"><a href="#1-7-3-删除参数" class="headerlink" title="1.7.3. 删除参数"></a>1.7.3. 删除参数</h3><ul>
<li>请求路径： categories/:id/attributes/:attrid</li>
<li>请求方法：delete</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>:attrid</td>
<td>参数 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: null,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;删除成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-7-4-根据-ID-查询参数"><a href="#1-7-4-根据-ID-查询参数" class="headerlink" title="1.7.4. 根据 ID 查询参数"></a>1.7.4. 根据 ID 查询参数</h3><ul>
<li>请求路径：categories/:id/attributes/:attrId</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>:attrId</td>
<td>属性 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>attr_sel</td>
<td>[only,many]</td>
<td>不能为空</td>
</tr>
<tr>
<td>attr_vals</td>
<td>如果是 many 就需要填写值的选项，以逗号分隔</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;attr_id&quot;: 1,</span><br><span class="line">        &quot;attr_name&quot;: &quot;cpu&quot;,</span><br><span class="line">        &quot;cat_id&quot;: 22,</span><br><span class="line">        &quot;attr_sel&quot;: &quot;only&quot;,</span><br><span class="line">        &quot;attr_write&quot;: &quot;manual&quot;,</span><br><span class="line">        &quot;attr_vals&quot;: &quot;ffff&quot;</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;获取成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-7-5-编辑提交参数"><a href="#1-7-5-编辑提交参数" class="headerlink" title="1.7.5. 编辑提交参数"></a>1.7.5. 编辑提交参数</h3><ul>
<li>请求路径：categories/:id/attributes/:attrId</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>:id</td>
<td>分类 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>:attrId</td>
<td>属性 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>attr_name</td>
<td>新属性的名字</td>
<td>不能为空，携带在<code>请求体</code>中</td>
</tr>
<tr>
<td>attr_sel</td>
<td>属性的类型[many或only]</td>
<td>不能为空，携带在<code>请求体</code>中</td>
</tr>
<tr>
<td>attr_vals</td>
<td>参数的属性值</td>
<td>可选参数，携带在<code>请求体</code>中</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;attr_id&quot;: 9,</span><br><span class="line">        &quot;attr_name&quot;: &quot;测试更新&quot;,</span><br><span class="line">        &quot;cat_id&quot;: &quot;43&quot;,</span><br><span class="line">        &quot;attr_sel&quot;: &quot;only&quot;,</span><br><span class="line">        &quot;attr_write&quot;: &quot;manual&quot;,</span><br><span class="line">        &quot;attr_vals&quot;: &quot;abc&quot;</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;更新成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="1-8-商品管理"><a href="#1-8-商品管理" class="headerlink" title="1.8. 商品管理"></a>1.8. 商品管理</h2><h3 id="1-8-1-商品列表数据"><a href="#1-8-1-商品列表数据" class="headerlink" title="1.8.1. 商品列表数据"></a>1.8.1. 商品列表数据</h3><ul>
<li>请求路径：goods</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>query</td>
<td>查询参数</td>
<td>可以为空</td>
</tr>
<tr>
<td>pagenum</td>
<td>当前页码</td>
<td>不能为空</td>
</tr>
<tr>
<td>pagesize</td>
<td>每页显示条数</td>
<td>不能为空</td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>total</td>
<td>总共商品条数</td>
<td></td>
</tr>
<tr>
<td>pagenum</td>
<td>当前商品页数</td>
<td></td>
</tr>
<tr>
<td>goods_id</td>
<td>商品 ID</td>
<td></td>
</tr>
<tr>
<td>goods_name</td>
<td>商品名称</td>
<td></td>
</tr>
<tr>
<td>goods_price</td>
<td>价格</td>
<td></td>
</tr>
<tr>
<td>goods_number</td>
<td>数量</td>
<td></td>
</tr>
<tr>
<td>goods_weight</td>
<td>重量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_state</td>
<td>商品状态</td>
<td>商品状态 0: 未通过 1: 审核中 2: 已审核</td>
</tr>
<tr>
<td>add_time</td>
<td>添加时间</td>
<td></td>
</tr>
<tr>
<td>upd_time</td>
<td>更新时间</td>
<td></td>
</tr>
<tr>
<td>hot_mumber</td>
<td>热销品数量</td>
<td></td>
</tr>
<tr>
<td>is_promote</td>
<td>是否是热销品</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;total&quot;: 50,</span><br><span class="line">        &quot;pagenum&quot;: &quot;1&quot;,</span><br><span class="line">        &quot;goods&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 144,</span><br><span class="line">                &quot;goods_name&quot;: &quot;asfdsd&quot;,</span><br><span class="line">                &quot;goods_price&quot;: 1,</span><br><span class="line">                &quot;goods_number&quot;: 1,</span><br><span class="line">                &quot;goods_weight&quot;: 1,</span><br><span class="line">                &quot;goods_state&quot;: null,</span><br><span class="line">                &quot;add_time&quot;: 1512954923,</span><br><span class="line">                &quot;upd_time&quot;: 1512954923,</span><br><span class="line">                &quot;hot_mumber&quot;: 0,</span><br><span class="line">                &quot;is_promote&quot;: false</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;获取成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-8-2-添加商品"><a href="#1-8-2-添加商品" class="headerlink" title="1.8.2. 添加商品"></a>1.8.2. 添加商品</h3><ul>
<li>请求路径：goods</li>
<li>请求方法：post</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>goods_name</td>
<td>商品名称</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_cat</td>
<td>以为’,’分割的分类列表</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_price</td>
<td>价格</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_number</td>
<td>数量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_weight</td>
<td>重量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_introduce</td>
<td>介绍</td>
<td>可以为空</td>
</tr>
<tr>
<td>pics</td>
<td>上传的图片临时路径（对象）</td>
<td>可以为空</td>
</tr>
<tr>
<td>attrs</td>
<td>商品的参数（数组），包含 <code>动态参数</code> 和 <code>静态属性</code></td>
<td>可以为空</td>
</tr>
</tbody></table>
<ul>
<li>请求数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  <span class="attr">"goods_name"</span>:<span class="string">"test_goods_name2"</span>,</span><br><span class="line">  <span class="attr">"goods_cat"</span>: <span class="string">"1,2,3"</span>,</span><br><span class="line">  <span class="attr">"goods_price"</span>:<span class="number">20</span>,</span><br><span class="line">  <span class="attr">"goods_number"</span>:<span class="number">30</span>,</span><br><span class="line">  <span class="attr">"goods_weight"</span>:<span class="number">40</span>,</span><br><span class="line">  <span class="attr">"goods_introduce"</span>:<span class="string">"abc"</span>,</span><br><span class="line">  <span class="attr">"pics"</span>:[</span><br><span class="line">    &#123;<span class="attr">"pic"</span>:<span class="string">"/tmp_uploads/30f08d52c551ecb447277eae232304b8"</span>&#125;</span><br><span class="line">    ],</span><br><span class="line">  <span class="attr">"attrs"</span>:[</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"attr_id"</span>:<span class="number">15</span>,</span><br><span class="line">      <span class="attr">"attr_value"</span>:<span class="string">"ddd"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"attr_id"</span>:<span class="number">15</span>,</span><br><span class="line">      <span class="attr">"attr_value"</span>:<span class="string">"eee"</span></span><br><span class="line">    &#125;</span><br><span class="line">    ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>total</td>
<td>总共商品条数</td>
<td></td>
</tr>
<tr>
<td>pagenum</td>
<td>当前商品页数</td>
<td></td>
</tr>
<tr>
<td>goods_id</td>
<td>商品 ID</td>
<td></td>
</tr>
<tr>
<td>goods_cat</td>
<td>以为’,’分割的分类列表</td>
<td></td>
</tr>
<tr>
<td>goods_name</td>
<td>商品名称</td>
<td></td>
</tr>
<tr>
<td>goods_price</td>
<td>价格</td>
<td></td>
</tr>
<tr>
<td>goods_number</td>
<td>数量</td>
<td></td>
</tr>
<tr>
<td>goods_weight</td>
<td>重量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_state</td>
<td>商品状态</td>
<td>商品状态 0: 未通过 1: 审核中 2: 已审核</td>
</tr>
<tr>
<td>add_time</td>
<td>添加时间</td>
<td></td>
</tr>
<tr>
<td>upd_time</td>
<td>更新时间</td>
<td></td>
</tr>
<tr>
<td>hot_mumber</td>
<td>热销品数量</td>
<td></td>
</tr>
<tr>
<td>is_promote</td>
<td>是否是热销品</td>
<td></td>
</tr>
<tr>
<td>pics</td>
<td>上传的图片临时路径（对象）</td>
<td>pics_id:图片 ID,goods_id:商品 ID,pics_big:大图,pics_mid:中图,pics_sma:小图</td>
</tr>
<tr>
<td>attrs</td>
<td>商品的参数（数组）</td>
<td>goods_id:商品 ID,attr_value:当前商品的参数值,add_price:浮动价格,attr_vals:预定义的参数值,attr_sel:手动输入，还是单选,</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"data"</span>: &#123;</span><br><span class="line">        <span class="attr">"goods_id"</span>: <span class="number">145</span>,</span><br><span class="line">        <span class="attr">"goods_name"</span>: <span class="string">"test_goods_name2"</span>,</span><br><span class="line">        <span class="attr">"goods_price"</span>: <span class="number">20</span>,</span><br><span class="line">        <span class="attr">"cat_id"</span>: <span class="number">1</span>,</span><br><span class="line">        <span class="attr">"goods_number"</span>: <span class="number">30</span>,</span><br><span class="line">        <span class="attr">"goods_weight"</span>: <span class="number">40</span>,</span><br><span class="line">        <span class="attr">"goods_introduce"</span>: <span class="string">"abc"</span>,</span><br><span class="line">        <span class="attr">"goods_big_logo"</span>: <span class="string">""</span>,</span><br><span class="line">        <span class="attr">"goods_small_logo"</span>: <span class="string">""</span>,</span><br><span class="line">        <span class="attr">"goods_state"</span>: <span class="number">1</span>,</span><br><span class="line">        <span class="attr">"add_time"</span>: <span class="number">1512962370</span>,</span><br><span class="line">        <span class="attr">"upd_time"</span>: <span class="number">1512962370</span>,</span><br><span class="line">        <span class="attr">"hot_mumber"</span>: <span class="number">0</span>,</span><br><span class="line">        <span class="attr">"is_promote"</span>: <span class="literal">false</span>,</span><br><span class="line">        <span class="attr">"pics"</span>: [</span><br><span class="line">            &#123;</span><br><span class="line">                <span class="attr">"pics_id"</span>: <span class="number">397</span>,</span><br><span class="line">                <span class="attr">"goods_id"</span>: <span class="number">145</span>,</span><br><span class="line">                <span class="attr">"pics_big"</span>: <span class="string">"uploads/goodspics/big_30f08d52c551ecb447277eae232304b8"</span>,</span><br><span class="line">                <span class="attr">"pics_mid"</span>: <span class="string">"uploads/goodspics/mid_30f08d52c551ecb447277eae232304b8"</span>,</span><br><span class="line">                <span class="attr">"pics_sma"</span>: <span class="string">"uploads/goodspics/sma_30f08d52c551ecb447277eae232304b8"</span></span><br><span class="line">            &#125;</span><br><span class="line">        ],</span><br><span class="line">        <span class="attr">"attrs"</span>: [</span><br><span class="line">            &#123;</span><br><span class="line">                <span class="attr">"goods_id"</span>: <span class="number">145</span>,</span><br><span class="line">                <span class="attr">"attr_id"</span>: <span class="number">15</span>,</span><br><span class="line">                <span class="attr">"attr_value"</span>: <span class="string">"ddd"</span>,</span><br><span class="line">                <span class="attr">"add_price"</span>: <span class="literal">null</span>,</span><br><span class="line">                <span class="attr">"attr_name"</span>: <span class="string">"fffffff"</span>,</span><br><span class="line">                <span class="attr">"attr_sel"</span>: <span class="string">"many"</span>,</span><br><span class="line">                <span class="attr">"attr_write"</span>: <span class="string">"list"</span>,</span><br><span class="line">                <span class="attr">"attr_vals"</span>: <span class="string">""</span></span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                <span class="attr">"goods_id"</span>: <span class="number">145</span>,</span><br><span class="line">                <span class="attr">"attr_id"</span>: <span class="number">15</span>,</span><br><span class="line">                <span class="attr">"attr_value"</span>: <span class="string">"eee"</span>,</span><br><span class="line">                <span class="attr">"add_price"</span>: <span class="literal">null</span>,</span><br><span class="line">                <span class="attr">"attr_name"</span>: <span class="string">"fffffff"</span>,</span><br><span class="line">                <span class="attr">"attr_sel"</span>: <span class="string">"many"</span>,</span><br><span class="line">                <span class="attr">"attr_write"</span>: <span class="string">"list"</span>,</span><br><span class="line">                <span class="attr">"attr_vals"</span>: <span class="string">""</span></span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">"meta"</span>: &#123;</span><br><span class="line">        <span class="attr">"msg"</span>: <span class="string">"创建商品成功"</span>,</span><br><span class="line">        <span class="attr">"status"</span>: <span class="number">201</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-8-3-根据-ID-查询商品"><a href="#1-8-3-根据-ID-查询商品" class="headerlink" title="1.8.3. 根据 ID 查询商品"></a>1.8.3. 根据 ID 查询商品</h3><ul>
<li>请求路径：goods/:id</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>商品 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>total</td>
<td>总共商品条数</td>
<td></td>
</tr>
<tr>
<td>pagenum</td>
<td>当前商品页数</td>
<td></td>
</tr>
<tr>
<td>goods_id</td>
<td>商品 ID</td>
<td></td>
</tr>
<tr>
<td>goods_name</td>
<td>商品名称</td>
<td></td>
</tr>
<tr>
<td>goods_price</td>
<td>价格</td>
<td></td>
</tr>
<tr>
<td>goods_number</td>
<td>数量</td>
<td></td>
</tr>
<tr>
<td>goods_weight</td>
<td>重量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_state</td>
<td>商品状态</td>
<td>商品状态 0: 未通过 1: 审核中 2: 已审核</td>
</tr>
<tr>
<td>add_time</td>
<td>添加时间</td>
<td></td>
</tr>
<tr>
<td>upd_time</td>
<td>更新时间</td>
<td></td>
</tr>
<tr>
<td>hot_mumber</td>
<td>热销品数量</td>
<td></td>
</tr>
<tr>
<td>is_promote</td>
<td>是否是热销品</td>
<td></td>
</tr>
<tr>
<td>pics</td>
<td>上传的图片临时路径（对象）</td>
<td>pics_id:图片 ID,goods_id:商品 ID,pics_big:大图,pics_mid:中图,pics_sma:小图</td>
</tr>
<tr>
<td>attrs</td>
<td>商品的参数（数组）</td>
<td>goods_id:商品 ID,attr_value:当前商品的参数值,add_price:浮动价格,attr_vals:预定义的参数值,attr_sel:手动输入，还是单选,</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;goods_id&quot;: 145,</span><br><span class="line">        &quot;goods_name&quot;: &quot;test_goods_name2&quot;,</span><br><span class="line">        &quot;goods_price&quot;: 20,</span><br><span class="line">        &quot;goods_number&quot;: 30,</span><br><span class="line">        &quot;goods_weight&quot;: 40,</span><br><span class="line">        &quot;goods_introduce&quot;: &quot;abc&quot;,</span><br><span class="line">        &quot;goods_big_logo&quot;: &quot;&quot;,</span><br><span class="line">        &quot;goods_small_logo&quot;: &quot;&quot;,</span><br><span class="line">        &quot;goods_state&quot;: 1,</span><br><span class="line">        &quot;add_time&quot;: 1512962370,</span><br><span class="line">        &quot;upd_time&quot;: 1512962370,</span><br><span class="line">        &quot;hot_mumber&quot;: 0,</span><br><span class="line">        &quot;is_promote&quot;: false,</span><br><span class="line">        &quot;pics&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;pics_id&quot;: 397,</span><br><span class="line">                &quot;goods_id&quot;: 145,</span><br><span class="line">                &quot;pics_big&quot;: &quot;uploads&#x2F;goodspics&#x2F;big_30f08d52c551ecb447277eae232304b8&quot;,</span><br><span class="line">                &quot;pics_mid&quot;: &quot;uploads&#x2F;goodspics&#x2F;mid_30f08d52c551ecb447277eae232304b8&quot;,</span><br><span class="line">                &quot;pics_sma&quot;: &quot;uploads&#x2F;goodspics&#x2F;sma_30f08d52c551ecb447277eae232304b8&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ],</span><br><span class="line">        &quot;attrs&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 145,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;ddd&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 145,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;eee&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;创建商品成功&quot;,</span><br><span class="line">        &quot;status&quot;: 201</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-8-4-编辑提交商品"><a href="#1-8-4-编辑提交商品" class="headerlink" title="1.8.4. 编辑提交商品"></a>1.8.4. 编辑提交商品</h3><ul>
<li>请求路径：goods/:id</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>商品 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>goods_name</td>
<td>商品名称</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_price</td>
<td>价格</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_number</td>
<td>数量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_weight</td>
<td>重量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_introduce</td>
<td>介绍</td>
<td>可以为空</td>
</tr>
<tr>
<td>pics</td>
<td>上传的图片临时路径（对象）</td>
<td>可以为空</td>
</tr>
<tr>
<td>attrs</td>
<td>商品的参数（数组）</td>
<td>可以为空</td>
</tr>
</tbody></table>
<ul>
<li>请求数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  &quot;goods_name&quot;:&quot;test_goods_name2&quot;,</span><br><span class="line">  &quot;goods_price&quot;:20,</span><br><span class="line">  &quot;goods_number&quot;:30,</span><br><span class="line">  &quot;goods_weight&quot;:40,</span><br><span class="line">  &quot;goods_introduce&quot;:&quot;abc&quot;,</span><br><span class="line">  &quot;pics&quot;:[</span><br><span class="line">    &#123;&quot;pic&quot;:&quot;&#x2F;tmp_uploads&#x2F;30f08d52c551ecb447277eae232304b8&quot;&#125;</span><br><span class="line">    ],</span><br><span class="line">  &quot;attrs&quot;:[</span><br><span class="line">    &#123;</span><br><span class="line">      &quot;attr_id&quot;:15,</span><br><span class="line">      &quot;attr_value&quot;:&quot;ddd&quot;</span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      &quot;attr_id&quot;:15,</span><br><span class="line">      &quot;attr_value&quot;:&quot;eee&quot;</span><br><span class="line">    &#125;</span><br><span class="line">    ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>响应参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>total</td>
<td>总共商品条数</td>
<td></td>
</tr>
<tr>
<td>pagenum</td>
<td>当前商品页数</td>
<td></td>
</tr>
<tr>
<td>goods_id</td>
<td>商品 ID</td>
<td></td>
</tr>
<tr>
<td>goods_name</td>
<td>商品名称</td>
<td></td>
</tr>
<tr>
<td>goods_price</td>
<td>价格</td>
<td></td>
</tr>
<tr>
<td>goods_number</td>
<td>数量</td>
<td></td>
</tr>
<tr>
<td>goods_weight</td>
<td>重量</td>
<td>不能为空</td>
</tr>
<tr>
<td>goods_state</td>
<td>商品状态</td>
<td>商品状态 0: 未通过 1: 审核中 2: 已审核</td>
</tr>
<tr>
<td>add_time</td>
<td>添加时间</td>
<td></td>
</tr>
<tr>
<td>upd_time</td>
<td>更新时间</td>
<td></td>
</tr>
<tr>
<td>hot_mumber</td>
<td>热销品数量</td>
<td></td>
</tr>
<tr>
<td>is_promote</td>
<td>是否是热销品</td>
<td></td>
</tr>
<tr>
<td>pics</td>
<td>上传的图片临时路径（对象）</td>
<td>pics_id:图片 ID,goods_id:商品 ID,pics_big:大图,pics_mid:中图,pics_sma:小图</td>
</tr>
<tr>
<td>attrs</td>
<td>商品的参数（数组）</td>
<td>goods_id:商品 ID,attr_value:当前商品的参数值,add_price:浮动价格,attr_vals:预定义的参数值,attr_sel:手动输入，还是单选,</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;goods_id&quot;: 145,</span><br><span class="line">        &quot;goods_name&quot;: &quot;test_goods_name2&quot;,</span><br><span class="line">        &quot;goods_price&quot;: 20,</span><br><span class="line">        &quot;goods_number&quot;: 30,</span><br><span class="line">        &quot;goods_weight&quot;: 40,</span><br><span class="line">        &quot;goods_introduce&quot;: &quot;abc&quot;,</span><br><span class="line">        &quot;goods_big_logo&quot;: &quot;&quot;,</span><br><span class="line">        &quot;goods_small_logo&quot;: &quot;&quot;,</span><br><span class="line">        &quot;goods_state&quot;: 1,</span><br><span class="line">        &quot;add_time&quot;: 1512962370,</span><br><span class="line">        &quot;upd_time&quot;: 1512962370,</span><br><span class="line">        &quot;hot_mumber&quot;: 0,</span><br><span class="line">        &quot;is_promote&quot;: false,</span><br><span class="line">        &quot;pics&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;pics_id&quot;: 397,</span><br><span class="line">                &quot;goods_id&quot;: 145,</span><br><span class="line">                &quot;pics_big&quot;: &quot;uploads&#x2F;goodspics&#x2F;big_30f08d52c551ecb447277eae232304b8&quot;,</span><br><span class="line">                &quot;pics_mid&quot;: &quot;uploads&#x2F;goodspics&#x2F;mid_30f08d52c551ecb447277eae232304b8&quot;,</span><br><span class="line">                &quot;pics_sma&quot;: &quot;uploads&#x2F;goodspics&#x2F;sma_30f08d52c551ecb447277eae232304b8&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ],</span><br><span class="line">        &quot;attrs&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 145,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;ddd&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 145,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;eee&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;创建商品成功&quot;,</span><br><span class="line">        &quot;status&quot;: 201</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-8-5-删除商品"><a href="#1-8-5-删除商品" class="headerlink" title="1.8.5. 删除商品"></a>1.8.5. 删除商品</h3><ul>
<li>请求路径：goods/:id</li>
<li>请求方法：delete</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>商品 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: null,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;删除成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>###同步商品图片</p>
<ul>
<li>请求路径：goods/:id/pics</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>商品 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>pics</td>
<td>商品图片集合</td>
<td>如果有 pics_id 字段会保留该图片，如果没有 pics_id 但是有 pic 字段就会新生成图片数据</td>
</tr>
</tbody></table>
<ul>
<li>请求数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">;[</span><br><span class="line">  &#123; pic: &#39;tmp_uploads&#x2F;db28f6316835836e97653b5c75e418be.png&#39; &#125;,</span><br><span class="line">  &#123;</span><br><span class="line">    pics_id: 397,</span><br><span class="line">    goods_id: 145,</span><br><span class="line">    pics_big: &#39;uploads&#x2F;goodspics&#x2F;big_30f08d52c551ecb447277eae232304b8&#39;,</span><br><span class="line">    pics_mid: &#39;uploads&#x2F;goodspics&#x2F;mid_30f08d52c551ecb447277eae232304b8&#39;,</span><br><span class="line">    pics_sma: &#39;uploads&#x2F;goodspics&#x2F;sma_30f08d52c551ecb447277eae232304b8&#39;</span><br><span class="line">  &#125;</span><br><span class="line">]</span><br></pre></td></tr></table></figure>

<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;goods_id&quot;: 96,</span><br><span class="line">        &quot;goods_name&quot;: &quot;iphoneXX&quot;,</span><br><span class="line">        &quot;goods_price&quot;: 2,</span><br><span class="line">        &quot;goods_number&quot;: 22,</span><br><span class="line">        &quot;goods_weight&quot;: 22,</span><br><span class="line">        &quot;goods_introduce&quot;: null,</span><br><span class="line">        &quot;goods_big_logo&quot;: &quot;.&#x2F;uploads&#x2F;goods&#x2F;20171113&#x2F;483a3b8e99e534ec3e4312dbbaee7c9d.jpg&quot;,</span><br><span class="line">        &quot;goods_small_logo&quot;: &quot;.&#x2F;uploads&#x2F;goods&#x2F;20171113&#x2F;small_483a3b8e99e534ec3e4312dbbaee7c9d.jpg&quot;,</span><br><span class="line">        &quot;goods_state&quot;: 0,</span><br><span class="line">        &quot;is_del&quot;: &quot;1&quot;,</span><br><span class="line">        &quot;add_time&quot;: 1510045904,</span><br><span class="line">        &quot;upd_time&quot;: 1512635159,</span><br><span class="line">        &quot;delete_time&quot;: 1512635159,</span><br><span class="line">        &quot;hot_mumber&quot;: 0,</span><br><span class="line">        &quot;is_promote&quot;: false,</span><br><span class="line">        &quot;pics&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;pics_id&quot;: 383,</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;pics_big&quot;: &quot;uploads&#x2F;goodspics&#x2F;big_6f5750132abd3f5b2b93dd722fcde653.jpg&quot;,</span><br><span class="line">                &quot;pics_mid&quot;: &quot;uploads&#x2F;goodspics&#x2F;mid_6f5750132abd3f5b2b93dd722fcde653.jpg&quot;,</span><br><span class="line">                &quot;pics_sma&quot;: &quot;uploads&#x2F;goodspics&#x2F;sma_6f5750132abd3f5b2b93dd722fcde653.jpg&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ],</span><br><span class="line">        &quot;attrs&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;eee&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;ddd&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;更新成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>###同步商品属性</p>
<ul>
<li>请求路径：goods/:id/attributes</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>商品 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>请求数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">;[</span><br><span class="line">  &#123;</span><br><span class="line">    attr_id: 15,</span><br><span class="line">    attr_value: &#39;ddd&#39;</span><br><span class="line">  &#125;,</span><br><span class="line">  &#123;</span><br><span class="line">    attr_id: 15,</span><br><span class="line">    attr_value: &#39;eee&#39;</span><br><span class="line">  &#125;</span><br><span class="line">]</span><br></pre></td></tr></table></figure>

<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;goods_id&quot;: 96,</span><br><span class="line">        &quot;goods_name&quot;: &quot;iphoneXX&quot;,</span><br><span class="line">        &quot;goods_price&quot;: 2,</span><br><span class="line">        &quot;goods_number&quot;: 22,</span><br><span class="line">        &quot;goods_weight&quot;: 22,</span><br><span class="line">        &quot;goods_introduce&quot;: null,</span><br><span class="line">        &quot;goods_big_logo&quot;: &quot;.&#x2F;uploads&#x2F;goods&#x2F;20171113&#x2F;483a3b8e99e534ec3e4312dbbaee7c9d.jpg&quot;,</span><br><span class="line">        &quot;goods_small_logo&quot;: &quot;.&#x2F;uploads&#x2F;goods&#x2F;20171113&#x2F;small_483a3b8e99e534ec3e4312dbbaee7c9d.jpg&quot;,</span><br><span class="line">        &quot;goods_state&quot;: 0,</span><br><span class="line">        &quot;is_del&quot;: &quot;1&quot;,</span><br><span class="line">        &quot;add_time&quot;: 1510045904,</span><br><span class="line">        &quot;upd_time&quot;: 1512635159,</span><br><span class="line">        &quot;delete_time&quot;: 1512635159,</span><br><span class="line">        &quot;hot_mumber&quot;: 0,</span><br><span class="line">        &quot;is_promote&quot;: false,</span><br><span class="line">        &quot;pics&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;pics_id&quot;: 383,</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;pics_big&quot;: &quot;uploads&#x2F;goodspics&#x2F;big_6f5750132abd3f5b2b93dd722fcde653.jpg&quot;,</span><br><span class="line">                &quot;pics_mid&quot;: &quot;uploads&#x2F;goodspics&#x2F;mid_6f5750132abd3f5b2b93dd722fcde653.jpg&quot;,</span><br><span class="line">                &quot;pics_sma&quot;: &quot;uploads&#x2F;goodspics&#x2F;sma_6f5750132abd3f5b2b93dd722fcde653.jpg&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ],</span><br><span class="line">        &quot;attrs&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;eee&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;attr_id&quot;: 15,</span><br><span class="line">                &quot;attr_value&quot;: &quot;ddd&quot;,</span><br><span class="line">                &quot;add_price&quot;: null,</span><br><span class="line">                &quot;attr_name&quot;: &quot;fffffff&quot;,</span><br><span class="line">                &quot;attr_sel&quot;: &quot;many&quot;,</span><br><span class="line">                &quot;attr_write&quot;: &quot;list&quot;,</span><br><span class="line">                &quot;attr_vals&quot;: &quot;&quot;</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;更新成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>###商品图片处理必须安装 GraphicsMagick</p>
<ul>
<li>linux</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt-get install GraphicsMagick</span><br></pre></td></tr></table></figure>

<ul>
<li>Mac OS X</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew install GraphicsMagick</span><br></pre></td></tr></table></figure>

<ul>
<li>Windows <a href="https://sourceforge.net/projects/graphicsmagick/files/graphicsmagick-binaries/1.3.27/GraphicsMagick-1.3.27-Q8-win64-dll.exe/download" target="_blank" rel="noopener">点击下载</a></li>
</ul>
<h2 id="1-9-图片上传"><a href="#1-9-图片上传" class="headerlink" title="1.9. 图片上传"></a>1.9. 图片上传</h2><ul>
<li>请求路径：upload</li>
<li>请求方法：post</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>file</td>
<td>上传文件</td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;tmp_path&quot;: &quot;tmp_uploads&#x2F;ccfc5179a914e94506bcbb7377e8985f.png&quot;,</span><br><span class="line">        &quot;url&quot;: &quot;http:&#x2F;&#x2F;127.0.0.1:8888tmp_uploads&#x2F;ccfc5179a914e94506bcbb7377e8985f.png&quot;</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;上传成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="1-10-订单管理"><a href="#1-10-订单管理" class="headerlink" title="1.10. 订单管理"></a>1.10. 订单管理</h2><h3 id="1-10-1-订单数据列表"><a href="#1-10-1-订单数据列表" class="headerlink" title="1.10.1. 订单数据列表"></a>1.10.1. 订单数据列表</h3><ul>
<li>请求路径：orders</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>query</td>
<td>查询参数</td>
<td>可以为空</td>
</tr>
<tr>
<td>pagenum</td>
<td>当前页码</td>
<td>不能为空</td>
</tr>
<tr>
<td>pagesize</td>
<td>每页显示条数</td>
<td>不能为空</td>
</tr>
<tr>
<td>user_id</td>
<td>用户 ID</td>
<td>可以为空</td>
</tr>
<tr>
<td>pay_status</td>
<td>支付状态</td>
<td>可以为空</td>
</tr>
<tr>
<td>is_send</td>
<td>是否发货</td>
<td>可以为空</td>
</tr>
<tr>
<td>order_fapiao_title</td>
<td>[‘个人’,’公司’]</td>
<td>可以为空</td>
</tr>
<tr>
<td>order_fapiao_company</td>
<td>公司名称</td>
<td>可以为空</td>
</tr>
<tr>
<td>order_fapiao_content</td>
<td>发票内容</td>
<td>可以为空</td>
</tr>
<tr>
<td>consignee_addr</td>
<td>发货地址</td>
<td>可以为空</td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;total&quot;: 1,</span><br><span class="line">        &quot;pagenum&quot;: &quot;1&quot;,</span><br><span class="line">        &quot;goods&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;order_id&quot;: 47,</span><br><span class="line">                &quot;user_id&quot;: 133,</span><br><span class="line">                &quot;order_number&quot;: &quot;itcast-59e7502d7993d&quot;,</span><br><span class="line">                &quot;order_price&quot;: 322,</span><br><span class="line">                &quot;order_pay&quot;: &quot;1&quot;,</span><br><span class="line">                &quot;is_send&quot;: &quot;是&quot;,</span><br><span class="line">                &quot;trade_no&quot;: &quot;&quot;,</span><br><span class="line">                &quot;order_fapiao_title&quot;: &quot;个人&quot;,</span><br><span class="line">                &quot;order_fapiao_company&quot;: &quot;&quot;,</span><br><span class="line">                &quot;order_fapiao_content&quot;: &quot;办公用品&quot;,</span><br><span class="line">                &quot;consignee_addr&quot;: &quot;a:7:&#123;s:6:\&quot;cgn_id\&quot;;i:1;s:7:\&quot;user_id\&quot;;i:133;s:8:\&quot;cgn_name\&quot;;s:9:\&quot;王二柱\&quot;;s:11:\&quot;cgn_address\&quot;;s:51:\&quot;北京市海淀区苏州街长远天地大厦305室\&quot;;s:7:\&quot;cgn_tel\&quot;;s:11:\&quot;13566771298\&quot;;s:8:\&quot;cgn_code\&quot;;s:6:\&quot;306810\&quot;;s:11:\&quot;delete_time\&quot;;N;&#125;&quot;,</span><br><span class="line">                &quot;pay_status&quot;: &quot;1&quot;,</span><br><span class="line">                &quot;create_time&quot;: 1508331565,</span><br><span class="line">                &quot;update_time&quot;: 1508331565</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;获取成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-10-2-修改订单状态"><a href="#1-10-2-修改订单状态" class="headerlink" title="1.10.2. 修改订单状态"></a>1.10.2. 修改订单状态</h3><ul>
<li>请求路径：orders/:id</li>
<li>请求方法：put</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>订单 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
<tr>
<td>is_send</td>
<td>订单是否发货</td>
<td>1:已经发货，0:未发货</td>
</tr>
<tr>
<td>order_pay</td>
<td>订单支付</td>
<td>支付方式 0 未支付 1 支付宝 2 微信 3 银行卡</td>
</tr>
<tr>
<td>order_price</td>
<td>订单价格</td>
<td></td>
</tr>
<tr>
<td>order_number</td>
<td>订单数量</td>
<td></td>
</tr>
<tr>
<td>pay_status</td>
<td>支付状态</td>
<td>订单状态： 0 未付款、1 已付款</td>
</tr>
</tbody></table>
<ul>
<li>请求数据说明<ul>
<li>所有请求数据都是增量更新，如果参数不填写，就不会更新该字段</li>
</ul>
</li>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;order_id&quot;: 67,</span><br><span class="line">        &quot;user_id&quot;: 1,</span><br><span class="line">        &quot;order_number&quot;: &quot;itcast-g7kmck71vjaujfgoi&quot;,</span><br><span class="line">        &quot;order_price&quot;: 20,</span><br><span class="line">        &quot;order_pay&quot;: &quot;0&quot;,</span><br><span class="line">        &quot;is_send&quot;: &quot;否&quot;,</span><br><span class="line">        &quot;trade_no&quot;: &quot;&quot;,</span><br><span class="line">        &quot;order_fapiao_title&quot;: &quot;个人&quot;,</span><br><span class="line">        &quot;order_fapiao_company&quot;: &quot;&quot;,</span><br><span class="line">        &quot;order_fapiao_content&quot;: &quot;&quot;,</span><br><span class="line">        &quot;consignee_addr&quot;: &quot;&quot;,</span><br><span class="line">        &quot;pay_status&quot;: &quot;0&quot;,</span><br><span class="line">        &quot;create_time&quot;: 1512533560,</span><br><span class="line">        &quot;update_time&quot;: 1512533560,</span><br><span class="line">        &quot;goods&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;id&quot;: 82,</span><br><span class="line">                &quot;order_id&quot;: 67,</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;goods_price&quot;: 333,</span><br><span class="line">                &quot;goods_number&quot;: 2,</span><br><span class="line">                &quot;goods_total_price&quot;: 999</span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;id&quot;: 83,</span><br><span class="line">                &quot;order_id&quot;: 67,</span><br><span class="line">                &quot;goods_id&quot;: 95,</span><br><span class="line">                &quot;goods_price&quot;: 666,</span><br><span class="line">                &quot;goods_number&quot;: 5,</span><br><span class="line">                &quot;goods_total_price&quot;: 999</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;获取成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="1-10-3-查看订单详情"><a href="#1-10-3-查看订单详情" class="headerlink" title="1.10.3. 查看订单详情"></a>1.10.3. 查看订单详情</h3><ul>
<li>请求路径：orders/:id</li>
<li>请求方法：get</li>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数说明</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>id</td>
<td>订单 ID</td>
<td>不能为空<code>携带在url中</code></td>
</tr>
</tbody></table>
<ul>
<li>响应数据</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;data&quot;: &#123;</span><br><span class="line">        &quot;order_id&quot;: 67,</span><br><span class="line">        &quot;user_id&quot;: 1,</span><br><span class="line">        &quot;order_number&quot;: &quot;itcast-g7kmck71vjaujfgoi&quot;,</span><br><span class="line">        &quot;order_price&quot;: 20,</span><br><span class="line">        &quot;order_pay&quot;: &quot;0&quot;,</span><br><span class="line">        &quot;is_send&quot;: &quot;否&quot;,</span><br><span class="line">        &quot;trade_no&quot;: &quot;&quot;,</span><br><span class="line">        &quot;order_fapiao_title&quot;: &quot;个人&quot;,</span><br><span class="line">        &quot;order_fapiao_company&quot;: &quot;&quot;,</span><br><span class="line">        &quot;order_fapiao_content&quot;: &quot;&quot;,</span><br><span class="line">        &quot;consignee_addr&quot;: &quot;&quot;,</span><br><span class="line">        &quot;pay_status&quot;: &quot;0&quot;,</span><br><span class="line">        &quot;create_time&quot;: 1512533560,</span><br><span class="line">        &quot;update_time&quot;: 1512533560,</span><br><span class="line">        &quot;goods&quot;: [</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;id&quot;: 82,</span><br><span class="line">                &quot;order_id&quot;: 67,</span><br><span class="line">                &quot;goods_id&quot;: 96,</span><br><span class="line">                &quot;goods_price&quot;: 333,</span><br><span class="line">                &quot;goods_number&quot;: 2,</span><br><span class="line">                &quot;goods_total_price&quot;: 999</span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                &quot;id&quot;: 83,</span><br><span class="line">                &quot;order_id&quot;: 67,</span><br><span class="line">                &quot;goods_id&quot;: 95,</span><br><span class="line">                &quot;goods_price&quot;: 666,</span><br><span class="line">                &quot;goods_number&quot;: 5,</span><br><span class="line">                &quot;goods_total_price&quot;: 999</span><br><span class="line">            &#125;</span><br><span class="line">        ]</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;meta&quot;: &#123;</span><br><span class="line">        &quot;msg&quot;: &quot;获取成功&quot;,</span><br><span class="line">        &quot;status&quot;: 200</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="1-10-4-修改地址"><a href="#1-10-4-修改地址" class="headerlink" title="1.10.4. 修改地址"></a>1.10.4. 修改地址</h3><ol>
<li><a href="https://github.com/iceyangcc/provinces-china" target="_blank" rel="noopener">省市区/县联动效果 - 结合ElementUI的 el-cascader 组件</a></li>
</ol>
<h3 id="1-10-5-查看物流信息"><a href="#1-10-5-查看物流信息" class="headerlink" title="1.10.5. 查看物流信息"></a>1.10.5. 查看物流信息</h3><ul>
<li><p>请求路径：/kuaidi/:id</p>
</li>
<li><p>请求方法：get</p>
</li>
<li><p>供测试的物流单号：1106975712662</p>
</li>
<li><p>响应数据：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  <span class="attr">"data"</span>: [</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-10 09:39:00"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-10 09:39:00"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"已签收,感谢使用顺丰,期待再次为您服务"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-10 08:23:00"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-10 08:23:00"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"[北京市]北京海淀育新小区营业点派件员 顺丰速运 95338正在为您派件"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-10 07:32:00"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-10 07:32:00"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"快件到达 [北京海淀育新小区营业点]"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-10 02:03:00"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-10 02:03:00"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"快件在[北京顺义集散中心]已装车,准备发往 [北京海淀育新小区营业点]"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-09 23:05:00"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-09 23:05:00"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"快件到达 [北京顺义集散中心]"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-09 21:21:00"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-09 21:21:00"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"快件在[北京宝胜营业点]已装车,准备发往 [北京顺义集散中心]"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-09 13:07:00"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-09 13:07:00"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"顺丰速运 已收取快件"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-09 12:25:03"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-09 12:25:03"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"卖家发货"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-09 12:22:24"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-09 12:22:24"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"您的订单将由HLA（北京海淀区清河中街店）门店安排发货。"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="attr">"time"</span>: <span class="string">"2018-05-08 21:36:04"</span>,</span><br><span class="line">      <span class="attr">"ftime"</span>: <span class="string">"2018-05-08 21:36:04"</span>,</span><br><span class="line">      <span class="attr">"context"</span>: <span class="string">"商品已经下单"</span>,</span><br><span class="line">      <span class="attr">"location"</span>: <span class="string">""</span></span><br><span class="line">    &#125;</span><br><span class="line">  ],</span><br><span class="line">  <span class="attr">"meta"</span>: &#123; <span class="attr">"status"</span>: <span class="number">200</span>, <span class="attr">"message"</span>: <span class="string">"获取物流信息成功！"</span> &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>


</li>
</ul>
<h2 id="1-11-数据统计"><a href="#1-11-数据统计" class="headerlink" title="1.11. 数据统计"></a>1.11. 数据统计</h2><h3 id="1-11-1-基于时间统计的折线图"><a href="#1-11-1-基于时间统计的折线图" class="headerlink" title="1.11.1.  基于时间统计的折线图"></a>1.11.1.  基于时间统计的折线图</h3><ul>
<li><p>请求路径：reports/type/1</p>
</li>
<li><p>请求方法：get</p>
</li>
<li><p>响应数据</p>
</li>
<li><p>需要合并的选项</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">options: &#123;</span><br><span class="line">        title: &#123;</span><br><span class="line">          text: <span class="string">'用户来源'</span></span><br><span class="line">        &#125;,</span><br><span class="line">        tooltip: &#123;</span><br><span class="line">          trigger: <span class="string">'axis'</span>,</span><br><span class="line">          axisPointer: &#123;</span><br><span class="line">            type: <span class="string">'cross'</span>,</span><br><span class="line">            label: &#123;</span><br><span class="line">              backgroundColor: <span class="string">'#E9EEF3'</span></span><br><span class="line">            &#125;</span><br><span class="line">          &#125;</span><br><span class="line">        &#125;,</span><br><span class="line">        grid: &#123;</span><br><span class="line">          left: <span class="string">'3%'</span>,</span><br><span class="line">          right: <span class="string">'4%'</span>,</span><br><span class="line">          bottom: <span class="string">'3%'</span>,</span><br><span class="line">          containLabel: <span class="literal">true</span></span><br><span class="line">        &#125;,</span><br><span class="line">        xAxis: [</span><br><span class="line">          &#123;</span><br><span class="line">            boundaryGap: <span class="literal">false</span></span><br><span class="line">          &#125;</span><br><span class="line">        ],</span><br><span class="line">        yAxis: [</span><br><span class="line">          &#123;</span><br><span class="line">            type: <span class="string">'value'</span></span><br><span class="line">          &#125;</span><br><span class="line">        ]</span><br><span class="line">      &#125;</span><br></pre></td></tr></table></figure></li>
</ul>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/06/07/vue%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96%E7%AC%94%E8%AE%B0/" rel="prev" title="ES6模块化笔记以及webpack简单的配置使用">
      <i class="fa fa-chevron-left"></i> ES6模块化笔记以及webpack简单的配置使用
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/06/12/token%E7%9A%84%E4%BD%BF%E7%94%A8/" rel="next" title="token的使用">
      token的使用 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#1-电商管理后台-API-接口文档"><span class="nav-number">1.</span> <span class="nav-text">1. 电商管理后台 API 接口文档</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-1-API-V1-接口说明"><span class="nav-number">1.1.</span> <span class="nav-text">1.1. API V1 接口说明</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-1-支持的请求方法"><span class="nav-number">1.1.1.</span> <span class="nav-text">1.1.1. 支持的请求方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-2-通用返回状态说明"><span class="nav-number">1.1.2.</span> <span class="nav-text">1.1.2. 通用返回状态说明</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-2-登录"><span class="nav-number">1.2.</span> <span class="nav-text">1.2. 登录</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-1-登录验证接口"><span class="nav-number">1.2.1.</span> <span class="nav-text">1.2.1. 登录验证接口</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-3-用户管理"><span class="nav-number">1.3.</span> <span class="nav-text">1.3. 用户管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-1-用户数据列表"><span class="nav-number">1.3.1.</span> <span class="nav-text">1.3.1. 用户数据列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-2-添加用户"><span class="nav-number">1.3.2.</span> <span class="nav-text">1.3.2. 添加用户</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-3-修改用户状态"><span class="nav-number">1.3.3.</span> <span class="nav-text">1.3.3. 修改用户状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-4-根据-ID-查询用户信息"><span class="nav-number">1.3.4.</span> <span class="nav-text">1.3.4. 根据 ID 查询用户信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-5-编辑用户提交"><span class="nav-number">1.3.5.</span> <span class="nav-text">1.3.5. 编辑用户提交</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-6-删除单个用户"><span class="nav-number">1.3.6.</span> <span class="nav-text">1.3.6. 删除单个用户</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-7-分配用户角色"><span class="nav-number">1.3.7.</span> <span class="nav-text">1.3.7. 分配用户角色</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-4-权限管理"><span class="nav-number">1.4.</span> <span class="nav-text">1.4. 权限管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-4-1-所有权限列表"><span class="nav-number">1.4.1.</span> <span class="nav-text">1.4.1. 所有权限列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-4-2-左侧菜单权限"><span class="nav-number">1.4.2.</span> <span class="nav-text">1.4.2. 左侧菜单权限</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-5-角色管理"><span class="nav-number">1.5.</span> <span class="nav-text">1.5. 角色管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-1-角色列表"><span class="nav-number">1.5.1.</span> <span class="nav-text">1.5.1. 角色列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-2-添加角色"><span class="nav-number">1.5.2.</span> <span class="nav-text">1.5.2. 添加角色</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-3-根据-ID-查询角色"><span class="nav-number">1.5.3.</span> <span class="nav-text">1.5.3. 根据 ID 查询角色</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-4-编辑提交角色"><span class="nav-number">1.5.4.</span> <span class="nav-text">1.5.4. 编辑提交角色</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-5-删除角色"><span class="nav-number">1.5.5.</span> <span class="nav-text">1.5.5. 删除角色</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-6-角色授权"><span class="nav-number">1.5.6.</span> <span class="nav-text">1.5.6. 角色授权</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-7-删除角色指定权限"><span class="nav-number">1.5.7.</span> <span class="nav-text">1.5.7. 删除角色指定权限</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-6-商品分类管理"><span class="nav-number">1.6.</span> <span class="nav-text">1.6. 商品分类管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-6-1-商品分类数据列表"><span class="nav-number">1.6.1.</span> <span class="nav-text">1.6.1. 商品分类数据列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-6-2-添加分类"><span class="nav-number">1.6.2.</span> <span class="nav-text">1.6.2. 添加分类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-6-3-根据-id-查询分类"><span class="nav-number">1.6.3.</span> <span class="nav-text">1.6.3. 根据 id 查询分类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-6-4-编辑提交分类"><span class="nav-number">1.6.4.</span> <span class="nav-text">1.6.4. 编辑提交分类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-6-5-删除分类"><span class="nav-number">1.6.5.</span> <span class="nav-text">1.6.5. 删除分类</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-7-分类参数管理"><span class="nav-number">1.7.</span> <span class="nav-text">1.7. 分类参数管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-7-1-参数列表"><span class="nav-number">1.7.1.</span> <span class="nav-text">1.7.1. 参数列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-7-2-添加动态参数或者静态属性"><span class="nav-number">1.7.2.</span> <span class="nav-text">1.7.2. 添加动态参数或者静态属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-7-3-删除参数"><span class="nav-number">1.7.3.</span> <span class="nav-text">1.7.3. 删除参数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-7-4-根据-ID-查询参数"><span class="nav-number">1.7.4.</span> <span class="nav-text">1.7.4. 根据 ID 查询参数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-7-5-编辑提交参数"><span class="nav-number">1.7.5.</span> <span class="nav-text">1.7.5. 编辑提交参数</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-8-商品管理"><span class="nav-number">1.8.</span> <span class="nav-text">1.8. 商品管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-8-1-商品列表数据"><span class="nav-number">1.8.1.</span> <span class="nav-text">1.8.1. 商品列表数据</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-8-2-添加商品"><span class="nav-number">1.8.2.</span> <span class="nav-text">1.8.2. 添加商品</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-8-3-根据-ID-查询商品"><span class="nav-number">1.8.3.</span> <span class="nav-text">1.8.3. 根据 ID 查询商品</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-8-4-编辑提交商品"><span class="nav-number">1.8.4.</span> <span class="nav-text">1.8.4. 编辑提交商品</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-8-5-删除商品"><span class="nav-number">1.8.5.</span> <span class="nav-text">1.8.5. 删除商品</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-9-图片上传"><span class="nav-number">1.9.</span> <span class="nav-text">1.9. 图片上传</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-10-订单管理"><span class="nav-number">1.10.</span> <span class="nav-text">1.10. 订单管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-10-1-订单数据列表"><span class="nav-number">1.10.1.</span> <span class="nav-text">1.10.1. 订单数据列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-10-2-修改订单状态"><span class="nav-number">1.10.2.</span> <span class="nav-text">1.10.2. 修改订单状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-10-3-查看订单详情"><span class="nav-number">1.10.3.</span> <span class="nav-text">1.10.3. 查看订单详情</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-10-4-修改地址"><span class="nav-number">1.10.4.</span> <span class="nav-text">1.10.4. 修改地址</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-10-5-查看物流信息"><span class="nav-number">1.10.5.</span> <span class="nav-text">1.10.5. 查看物流信息</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-11-数据统计"><span class="nav-number">1.11.</span> <span class="nav-text">1.11. 数据统计</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-11-1-基于时间统计的折线图"><span class="nav-number">1.11.1.</span> <span class="nav-text">1.11.1.  基于时间统计的折线图</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Edison</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">124</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">21</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
</div>
  <div class="powered-by">山高水远  一定相见
  </div>
<div></div>
<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">至今已写107.1k字</span>
</div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
